<!DOCTYPE html>
<html >
<head>
	<meta charset="UTF-8">
	<title>blog</title>
   <link rel="stylesheet"  href="style.css">
</head>
<body>
<?php
 include("function.php");
 $conn = conn();
 $id=$_GET['id'];
 $result=mysqli_query($conn,"select * from article where id=$id ");//从article表中取某一行的信息（取出来的是一个结果集不能直接输出）

 mysqli_query($conn,"update article set view=view+1 where id=$id");

 $data=mysqli_fetch_assoc($result);//把$result中取出的结果集进行包装，包装的成数组的形式，并赋值给 $data



 
 ?>
	<div id="head">
		<h1><?php  echo $data['title']?></h1>
		<ul id="nav">
			<li><a href="index4.php">首页</a></li>
			<?php
			$result=mysqli_query($conn,"select * from catalog ");

            while($row= mysqli_fetch_assoc($result)){
            ?>	
            <li><a href="list.php?cata_id=<?php  echo $row['id'] ?>"><?php  echo $row['name'] ?></a></li>


            <?php
            }
 	       ?>	
        </ul>
	</div>
	
	<div id="main">
	    <div id="item">
	    <?php echo $data['content'] ?>
	    </div>
			
	</div>

 


</body>
</html>